home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
CUGUK
/
GAMES
/
C014.ZIP
/
LARN_SRC.ZIP
/
PATCHES0
< prev
next >
Wrap
Text File
|
1993-11-17
|
11KB
|
353 lines
*** patchlog.org Mon May 13 21:26:38 1991
--- patchlog Mon May 13 21:24:36 1991
***************
*** 0 ****
--- 1,16 ----
+ Patch 1
+ =======
+
+ Prompted by Pat Ryan, fix a bug in the dropobj() code in main.c that
+ allowed the player to drop a negative amount of gold. In the process, fix
+ the backwards carriage return logic when printing the error response.
+
+ Document the new SIG_RETURNS_INT #define introduced by Bill Randle when the
+ software was posted.
+
+ Prompted by Lasse Oestergaard, guard against out-of-bound array references
+ in movem.c when on the Home level. Also fixed a bug where a 'smart' monster
+ would fail to move towards the player when the player was on the boundary.
+
+ Prompted by Mitch Gorman, make the EXTRA #define compile and work under
+ MS-DOS.
*** patchlev.org Sat Mar 23 14:08:52 1991
--- patchlev.h Mon May 13 21:17:10 1991
***************
*** 1,3 ****
/* indicate which patches have been applied to Larn.
*/
! #define PATCHLEVEL 0
--- 1,3 ----
/* indicate which patches have been applied to Larn.
*/
! #define PATCHLEVEL 1
*** config.org Sat Jul 07 13:58:52 1990
--- config.c Mon May 13 20:32:26 1991
***************
*** 73,78 ****
--- 73,81 ----
char ckpfile[PATHLEN];
char swapfile[PATHLEN];
char larndir[DIRLEN] = LARNHOME;
+ # ifdef EXTRA
+ char diagfile[PATHLEN]; /* the diagnostic filename */
+ # endif
# else
char savefilename[PATHLEN] = LARNHOME;
char scorefile[PATHLEN] = LARNHOME;
*** diag.org Sat Jul 07 13:47:32 1990
--- diag.c Mon May 13 20:32:16 1991
***************
*** 24,29 ****
--- 24,31 ----
extern int rmst,maxitm,lasttime;
extern char nosignal;
+ #define max( _a, _b ) (( _a > _b ) ? _a : _b )
+
/*
***************************
DIAG -- dungeon diagnostics
***************
*** 124,129 ****
--- 126,133 ----
lcreat((char*)0); lprcat("Done Diagnosing . . .");
return(0);
}
+
+ #ifndef MSDOS
/*
subroutine to count the number of occurrences of an object
*/
***************
*** 139,144 ****
--- 143,149 ----
if (cell[(long) p*MAXX*MAXY+i*MAXY+j].item == l) k++;
return(k);
}
+ #endif
/*
subroutine to draw the whole screen as the player knows it
*** header.org Mon Dec 24 14:10:10 1990
--- header.h Mon May 13 20:31:28 1991
***************
*** 22,27 ****
--- 22,28 ----
#define FORTSNAME "larn.ftn"
#define PLAYERIDS "larn.pid"
#define HOLIFILE "holidays"
+ #define DIAGFILE "Diagfile"
#ifdef MSDOS
# define LARNOPTS "larn.opt"
# define SAVEFILE "larn.sav"
*** io.org Tue Mar 26 14:39:08 1991
--- io.c Mon May 13 20:32:20 1991
***************
*** 57,62 ****
--- 57,66 ----
#include "larndefs.h"
#include <ctype.h>
+ #ifdef EXTRA
+ # include "player.h"
+ #endif
+
#ifdef SYSV /* system III or system V */
# ifndef MSDOS
# include <termio.h>
*** main.org Tue Mar 26 15:00:36 1991
--- main.c Mon May 13 20:32:22 1991
***************
*** 167,178 ****
/* Savefile and swapfile can be given explicitly as options
*/
! if (!savefilename[0])
{
strcpy(savefilename, larndir);
strcat(savefilename, SAVEFILE);
}
! if (!swapfile[0])
{
strcpy(swapfile, larndir);
strcat(swapfile, SWAPFILE);
--- 167,178 ----
/* Savefile and swapfile can be given explicitly as options
*/
! if (!savefilename[0])
{
strcpy(savefilename, larndir);
strcat(savefilename, SAVEFILE);
}
! if (!swapfile[0])
{
strcpy(swapfile, larndir);
strcat(swapfile, SWAPFILE);
***************
*** 184,193 ****
strcpy(fortfile, larndir);
strcpy(playerids, larndir);
strcpy(ckpfile, larndir);
# else /* MSDOS */
! if ((ptr = getenv("HOME")) == 0)
ptr = ".";
#ifdef SAVEINHOME
/* save file name in home directory */
--- 184,196 ----
strcpy(fortfile, larndir);
strcpy(playerids, larndir);
strcpy(ckpfile, larndir);
+ # ifdef EXTRA
+ strcpy(diagfile,larndir);
+ # endif
# else /* MSDOS */
! if ((ptr = getenv("HOME")) == 0)
ptr = ".";
#ifdef SAVEINHOME
/* save file name in home directory */
***************
*** 220,225 ****
--- 223,232 ----
strcat(holifile, HOLIFILE); /* the holiday data file name */
# endif
+ # ifdef EXTRA
+ strcat(diagfile, DIAGFILE);
+ # endif
+
#ifdef VT100
/*
* check terminal type to avoid users who have not vt100 type terminals
***************
*** 1036,1049 ****
{
register int i;
register char *p;
! long amt;
p = &item[playerx][playery];
while (1)
{
! if ((i = whatitem("drop"))=='\33')
return;
! if (i=='*')
{
i = showstr(TRUE);
cursors();
--- 1043,1056 ----
{
register int i;
register char *p;
! unsigned long amt;
p = &item[playerx][playery];
while (1)
{
! if ((i = whatitem("drop"))=='\33')
return;
! if (i=='*')
{
i = showstr(TRUE);
cursors();
***************
*** 1059,1065 ****
if ((amt=readnum((long)c[GOLD])) == 0) return;
if (amt>c[GOLD])
{
! #ifndef MSDOS
lprcat("\n");
#endif MSDOS
lprcat("You don't have that much!");
--- 1066,1072 ----
if ((amt=readnum((long)c[GOLD])) == 0) return;
if (amt>c[GOLD])
{
! #ifdef MSDOS
lprcat("\n");
#endif MSDOS
lprcat("You don't have that much!");
*** makefile.org Sat Mar 23 19:09:40 1991
--- makefile.pc Mon May 13 21:15:22 1991
***************
*** 31,36 ****
--- 31,38 ----
# RFCMAIL - mail messages are RFC822 conformant. Must be used with
# MAIL above.
# SAVEINHOME - put save files in users HOME instead of LARNHOME (default)
+ # SIG_RETURNS_INT - define if signal() returns (int *)() instead of
+ # (void *)()
# SYSV - use system III/V (instead of V7) type ioctl calls
# TIMECHECK - incorporates code to disable play during working hours (8-5)
# UIDSCORE - Define to use user id's to manage scoreboard. Leaving this
*** movem.org Sat Mar 23 16:14:34 1991
--- movem.c Mon May 13 18:03:26 1991
***************
*** 311,323 ****
/* test all spots around the current one being looked at.
*/
! if ( ( curx >= xl && curx < xh ) &&
! ( cury >= yl && cury < yh ) )
{
for (z=1; z<9; z++)
{
tmpx = curx + diroffx[z] ;
tmpy = cury + diroffy[z] ;
if (screen[tmpx][tmpy] == 0 )
{
screen[tmpx][tmpy] = curdist + 1;
--- 311,324 ----
/* test all spots around the current one being looked at.
*/
! if ( ( curx >= xl && curx <= xh ) &&
! ( cury >= yl && cury <= yh ) )
{
for (z=1; z<9; z++)
{
tmpx = curx + diroffx[z] ;
tmpy = cury + diroffy[z] ;
+ vxy( &tmpx, &tmpy );
if (screen[tmpx][tmpy] == 0 )
{
screen[tmpx][tmpy] = curdist + 1;
***************
*** 448,453 ****
--- 449,459 ----
xl=i-1; yl=j-1; xh=i+2; yh=j+2;
if (i<playerx) xl++; else if (i>playerx) --xh;
if (j<playery) yl++; else if (j>playery) --yh;
+
+ if (xl < 0) xl = 0;
+ if (yl < 0) yl = 0;
+ if (xh > MAXX) xh = MAXX; /* MAXX OK; loop check below is <, not <= */
+ if (yh > MAXY) yh = MAXY; /* MAXY OK; loop check below is <, not <= */
/* check all spots in the range. find the one that is closest to
the player. if the monster is already next to the player, exit
*** scores.org Sun Mar 03 23:59:52 1991
--- scores.c Mon May 13 20:32:30 1991
***************
*** 72,78 ****
--- 72,80 ----
long moves; /* number of moves made by player */
short ac; /* armor class of player */
short hp,hpmax; /* players hitpoints */
+ # ifndef MSDOS
short cputime; /* cpu time needed in seconds */
+ # endif
short killed,spused;/* monsters killed and spells cast */
short usage; /* usage of the cpu in % */
short lev; /* player level */
***************
*** 511,519 ****
--- 513,523 ----
register int f,win;
char ch,*mod;
long zzz,i;
+ #ifndef MSDOS
# ifdef EXTRA
struct tms cputime;
# endif
+ #endif
if (c[LIFEPROT]>0) /* if life protection */
{
switch((x>0) ? x : -x)
***************
*** 572,579 ****
--- 576,585 ----
time(&zzz); /* get cpu time -- write out score info */
logg.diedtime=zzz;
#ifdef EXTRA
+ # ifndef MSDOS
times(&cputime); /* get cpu time -- write out score info */
logg.cputime = i = (cputime.tms_utime + cputime.tms_stime)/60 + c[CPUTIME];
+ # endif
logg.lev=c[LEVEL]; logg.ac=c[AC];
logg.hpmax=c[HPMAX]; logg.hp=c[HP];
logg.elapsedtime=(zzz-initialtime+59)/60;
***************
*** 645,653 ****
#ifdef EXTRA
if (logg.moves<=0) logg.moves=1;
lprintf(" Experience Level: %d, AC: %d, HP: %d/%d, Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
lprintf(" CPU time used: %d seconds, Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
lprintf(" BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
! lprintf(" out bytes per move: %d, time per move: %d ms\n",(long)(logg.bytout/logg.moves),(long)((logg.cputime*1000)/logg.moves));
#endif
}
lflush(); lrclose(); return;
--- 651,665 ----
#ifdef EXTRA
if (logg.moves<=0) logg.moves=1;
lprintf(" Experience Level: %d, AC: %d, HP: %d/%d, Elapsed Time: %d minutes\n",(long)(logg.lev),(long)(logg.ac),(long)(logg.hp),(long)(logg.hpmax),(long)(logg.elapsedtime));
+ # ifndef MSDOS
lprintf(" CPU time used: %d seconds, Machine usage: %d.%02d%%\n",(long)(logg.cputime),(long)(logg.usage/100),(long)(logg.usage%100));
+ # endif
lprintf(" BYTES in: %d, out: %d, moves: %d, deaths: %d, spells cast: %d\n",(long)(logg.bytin),(long)(logg.bytout),(long)(logg.moves),(long)(logg.killed),(long)(logg.spused));
! lprintf(" out bytes per move: %d",(long)(logg.bytout/logg.moves));
! # ifndef MSDOS
! lprintf(", time per move: %d ms",(long)((logg.cputime*1000)/logg.moves));
! # endif
! lprintf("\n");
#endif
}
lflush(); lrclose(); return;